<template>
    <div class="player-manager-view">
        <template>
            <v-card>
                <v-toolbar color="indigo" dark flat>
                    <v-toolbar-title>{{playerName + '玩家管理面板'}}</v-toolbar-title>
                    <v-spacer></v-spacer>
                    <template v-slot:extension>
                        <v-tabs v-model="tab" :grow="true" align-with-title @change="tabChange">
                            <v-tabs-slider color="yellow"></v-tabs-slider>
                            <v-tab v-for="item in items" :key="item">
                                {{ item }}
                            </v-tab>
                        </v-tabs>
                    </template>
                </v-toolbar>
                <v-tabs-items v-model="tab">
                    <v-tab-item>
                        <v-card flat>
                            <BaseInfo/>
                        </v-card>
                    </v-tab-item>
                    <v-tab-item>
                        <v-card flat>
                            <GlobalMarket/>
                        </v-card>
                    </v-tab-item>
                    <v-tab-item>
                        <v-card flat>
                            <AssetsInfo/>
                        </v-card>
                    </v-tab-item>
                </v-tabs-items>
            </v-card>
        </template>
    </div>
</template>

<script>
    import BaseInfo from "./PlayerManager/BaseInfo";
    import GlobalMarket from "./PlayerManager/GlobalMarket";
    import AssetsInfo from "./PlayerManager/AssetsInfo";
    import common from "../common";
    export default {
        name: "PlayerManagerView",
        components: {
            BaseInfo,
            GlobalMarket,
            AssetsInfo
        },
        data() {
            return {
                tab: '基本资料',
                items: [
                    '基本资料', '全球市场', '记录查询'
                ],
                playerId: '',
                playerName: ''
            }
        },
        mounted() {
            this.playerId = common.getCookie('playerId')
            this.playerName = common.getCookie('playerName')
            if (!!!this.playerName) {
                this.$router.replace('introduction')
            }
        },
        methods: {
            tabChange() {
                console.log(this.tab)
            },
        }
    }
</script>

<style scoped>

</style>
